<!DOCTYPE html>
<html>
<p>This test ensures context click around meter won't crash.</p>
<div id='container' style="width:100px; height: 100px"></div>
<p>PASS</p>

<script>
if (window.testRunner)
    testRunner.dumpAsText();

function contextClick(x, y) {
    eventSender.mouseMoveTo(x, y);
    eventSender.contextClick();
}

var container = document.getElementById('container');
var shadowRoot = container.attachShadow({mode: 'open'});
var meter = document.createElement('meter');
shadowRoot.appendChild(meter);

// Do context click at various points.
contextClick(meter.offsetLeft, meter.offsetTop);
contextClick(meter.offsetLeft - 1, meter.offsetTop);
contextClick(meter.offsetLeft, meter.offsetTop - 1);
contextClick(meter.offsetLeft - 1, meter.offsetTop - 1);
contextClick(meter.offsetLeft + 1, meter.offsetTop);
contextClick(meter.offsetLeft, meter.offsetTop + 1);
contextClick(meter.offsetLeft + 1, meter.offsetTop + 1);
contextClick(meter.offsetLeft + meter.offsetWidth / 2, meter.offsetTop + meter.offsetHeight / 2);
contextClick(meter.offsetLeft + meter.offsetWidth - 1, meter.offsetTop + meter.offsetHeight - 1);
contextClick(meter.offsetLeft + meter.offsetWidth + 1, meter.offsetTop + meter.offsetHeight + 1);
</script>
</body>
</html>
